package com.kingyea.mobilepolice.util;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * @author Mr.Lin
 * @version v1.0.0
 * @description 全局常量
 * @date Created in 201-1-1 00:15:41
 */
@Component
@ConfigurationProperties(prefix = "kingyea.mobilepolice.auth")
//@PropertySource(value = {"classpath:bootstrap.yml"},encoding="UTF-8")// 依赖set方法
public class GlobalVar extends GlobalVarComm {

    /**
     * 用户缓存到redis的key的前缀
     */
    public final static String user_prefix = "_user:";
    /**
     * activemq 相关
     */
    public static String MQ_BROKER_URL = "";//tcp://localhost:61616
    public static String MQ_SUBJECT = "";//InvokedMethod.uam.querer
    public static String MQ_SUBJECT_TOKEN = "";//InvokedMethod.uam.querer
    public static String MQ_USERNAME = "";//user
    public static String MQ_PASSWORD = "";//123
    private static Boolean isDev = false;

    public static Boolean getIsDev() {
        return isDev;
    }

    @Value("${kingyea.mobilepolice.auth.isDev}")
    public void setIsDev(Boolean isDev) {
        GlobalVar.isDev = isDev;
    }

    public static String getTOKENNAME() {
        return TOKENNAME;
    }

    public static String getCharsetUtf8() {
        return CHARSET_UTF8;
    }

    public static String getMqBrokerUrl() {
        return MQ_BROKER_URL;
    }

    @Value("${kingyea.mobilepolice.auth.MQ_BROKER_URL}")
    public void setMqBrokerUrl(String mqBrokerUrl) {
        MQ_BROKER_URL = mqBrokerUrl;
    }

    public static String getMqSubject() {
        return MQ_SUBJECT;
    }

    @Value("${kingyea.mobilepolice.auth.MQ_SUBJECT}")
    public void setMqSubject(String mqSubject) {
        MQ_SUBJECT = mqSubject;
    }

    public static String getMqUsername() {
        return MQ_USERNAME;
    }

    @Value("${kingyea.mobilepolice.auth.MQ_USERNAME}")
    public void setMqUsername(String mqUsername) {
        MQ_USERNAME = mqUsername;
    }

    public static String getMqPassword() {
        return MQ_PASSWORD;
    }

    @Value("${kingyea.mobilepolice.auth.MQ_PASSWORD}")
    public void setMqPassword(String mqPassword) {
        MQ_PASSWORD = mqPassword;
    }

    public static String getMqSubjectToken() {
        return MQ_SUBJECT_TOKEN;
    }

    @Value("${kingyea.mobilepolice.auth.MQ_SUBJECT_TOKEN}")
    public void setMqSubjectToken(String mqSubjectToken) {
        MQ_SUBJECT_TOKEN = mqSubjectToken;
    }

    public static String getUser_prefix() {
        return user_prefix;
    }
}
